﻿@using DualControl.Web.Models.Common.Modals
@using DualControl.CommonServices

@model DualControl.CompanyInfos.Dtos.CompanyInfoEditDto

    @inject ICommonService CommonService

    @{
    Layout = null;
    }
    @Html.Partial("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel("编辑企业概况"))

    <div class="modal-body">

        <form name="UserEditForm" role="form" novalidate class="form-validation">
            <input type="hidden" name="Id" value="@Model.Id" />
            <ul class="nav nav-tabs tab-nav-right" role="tablist">
                <li role="presentation" class="active"><a href="#create-companyinfo-details" data-toggle="tab">基础信息</a></li>
                <li role="presentation"><a href="#workplacetype-list" data-toggle="tab">企业是否存在危险作业场所</a></li>
            </ul>

            <div class="tab-content">
                <div role="tabpanel" class="tab-pane animated fadeIn active" id="create-companyinfo-details">
                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">企业名称</label>
                                <input class="form-control" type="text" name="CompanyFullName" required value="@Model.CompanyFullName" placeholder="请输入企业名称">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">企业地址</label>
                                <input class="form-control" type="text" name="Address" placeholder="请输入企业地址" value="@Model.Address" required>
                            </div>
                        </div>
                    </div>
                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">所在城市</label>
                                <input class="form-control" type="text" name="City" placeholder="请输入所在城市" value="@Model.City" required>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">邮政编码</label>
                                <input class="form-control" type="text" name="ZipCode" placeholder="请输入邮政编码" value="@Model.ZipCode" required>
                            </div>
                        </div>
                    </div>
                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">安全机构人员</label>
                                <input class="form-control" type="text" name="Safetyofficer" placeholder="请输入安全机构人员" required value="@Model.Safetyofficer">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">员工总数</label>
                                <input class="form-control" type="text" name="EmployeeNumber" placeholder="请输入员工总数" value="@Model.EmployeeNumber" required>
                            </div>
                        </div>
                    </div>
                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">专职/兼职安全员</label>

                                <input class="form-control" type="text" name="SafetyManagermentPerson" placeholder="请输入专职/兼职安全员" value="@Model.SafetyManagermentPerson" required>

                            </div>

                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">特种作业人数</label>
                                <input class="form-control" type="text" name="SpecialOperationNumber" placeholder="请输入特种作业人数" required value="@Model.SpecialOperationNumber">
                            </div>
                        </div>
                    </div>

                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">法定代表</label>

                                <input class="form-control" type="text" name="LegalRepresentative" placeholder="请输入法定代表" value="@Model.LegalRepresentative" required>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">请输入公司电话</label>
                                <input class="form-control" type="text" name="CompanyPhone" placeholder="请输入公司电话" value="@Model.CompanyPhone" required minlength="3">
                            </div>
                        </div>
                    </div>

                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">联系人</label>

                                <input class="form-control" type="text" name="Contact" placeholder="联系人" value="@Model.Contact" required>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">请输入联系人固定电话</label>
                                <input class="form-control" type="text" name="ContactFixedPhone" placeholder="请输入联系人固定电话" value="@Model.ContactFixedPhone" required minlength="3">
                            </div>
                        </div>
                    </div>

                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">生产许可证</label>

                                <input class="form-control" type="text" name="ProductionLicense" placeholder="输入生产许可证" value="@Model.ProductionLicense" required>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">有效期</label>
                                <input class="form-control" type="text" name="ExpireTime" placeholder="请输入有效期" required value="@Model.ExpireTime" >
                            </div>
                        </div>
                    </div>

                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">开采方式</label>

                                <input class="form-control" type="text" name="MiningMethod" placeholder="输入开采方式" value="@Model.MiningMethod" required>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="form-group form-float">
                                <label class="form-label">生产规模(万吨)</label>
                                <input class="form-control" type="text" name="ProductionScale" placeholder="请输入生产规模" value="@Model.ProductionScale" required>
                            </div>
                        </div>
                    </div>

                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-12">
                            <div class="form-group form-float">
                                <label class="form-label">企业概况</label>

                                <textarea class="form-control" name="BriefIntroduction" placeholder="请输入企业概况">@Model.BriefIntroduction</textarea>

                            </div>

                        </div>
                    </div>

                </div>


    <div role="tabpanel" class="tab-pane animated fadeIn" id="workplacetype-list">
                    <div class="row clearfix" style="margin-top:10px;">
                        <div class="col-sm-12 ">
            <label class="form-label">企业是否存在危险作业场所</label>
            <div class="form-group form-float">
                @foreach (var workplacetype in CommonService.HazardousWorkPlaceTypes())
                {
                    @if (Model.HazardousWorkPlaceTypes.Contains(workplacetype.Key.ToString()))
                    {
                        <input type="checkbox" name="workplacelist" value="@workplacetype.Key" title="@workplacetype.Value" class="filled-in" checked="checked" id="role-@workplacetype.Key" /> @workplacetype.Value
                    }
                    else
                    {
                        <input type="checkbox" name="workplacelist" value="@workplacetype.Key" title="@workplacetype.Value" class="filled-in" id="role-@workplacetype.Key" />
                        @workplacetype.Value
                    }

                }
            </div>
                        </div>
                    </div>

                </div>
            </div>
        </form>
    </div>

    @Html.Partial("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")

    <script src="~/view-resources/Views/CompanyInfo/_EditCompanyInfoModal.js" asp-append-version="true"></script>
